//
//  YMAudioEncoding.h
//  YMDemo
//
//  Created by admin on 2022/2/25.
//

#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#import "YMAudioFrame.h"
#import "YMLiveAudioConfiguration.h"



@protocol YMAudioEncoding;
/// 编码器编码后回调
@protocol YMAudioEncodingDelegate <NSObject>
@required
- (void)audioEncoder:(nullable id<YMAudioEncoding>)encoder audioFrame:(nullable YMAudioFrame *)frame;
@end

/// 编码器抽象的接口
@protocol YMAudioEncoding <NSObject>
@required
- (void)encodeAudioData:(nullable NSData*)audioData timeStamp:(uint64_t)timeStamp;
- (void)stopEncoder;
@optional
- (nullable instancetype)initWithAudioStreamConfiguration:(nullable YMLiveAudioConfiguration *)configuration;
- (void)setDelegate:(nullable id<YMAudioEncodingDelegate>)delegate;
- (nullable NSData *)adtsData:(NSInteger)channel rawDataLength:(NSInteger)rawDataLength;
@end

